package com.zua.service.impl;
import com.zua.entity.Order;
import com.zua.mapper.OrderMapper;
import com.zua.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
@Transactional(readOnly = false,timeout = 5,propagation = Propagation.REQUIRED,isolation = Isolation.READ_COMMITTED)
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public List<Order> selectAll(int pageNum, int pageSize) {
        return orderMapper.selectAll(pageNum,pageSize);
    }
    @Override
    public List<Order> selectByUserId(int userId) {
        return orderMapper.selectByUserId(userId);
    }
    @Override
    public Order selectById(int id) {
        return orderMapper.selectById(id);
    }
    @Override
    public void deleteById(int id) {
        orderMapper.deleteById(id);
    }
    @Override
    public void insertOrder(Order order) {
        orderMapper.insertOrder(order);
    }
    @Override
    public void updateOrder(Order order) {
        orderMapper.updateOrder(order);
    }
    @Override
    public void payOrder(int id) {
        orderMapper.payOrder(id);
    }
    @Override
    public void finishOrder(int id) {
        orderMapper.finishOrder(id);
    }
}
